import json

data = {
    'name' : 'zhangdasan',
    'age' : 21,
    'email' : 'zdsan@163.com'
}

with open('test.json', 'w') as f:
	json.dump(data, f)
	print('成功写入数据到文件！\n')
	f.close()

with open('test.json', encoding='utf-8') as f:
    line = f.readline()
    d = json.loads(line)
    name = d['name']
    age = d['age']
    email = d['email']
    print(name, age, email)
    f.close()
